#pragma once

namespace one_rag {
  namespace Core {

    template<typename KeyT, typename ValueT>
    class Dictionary {
    public:
      Dictionary();
      ~Dictionary();
      ValueT& operator[](KeyT key);
      ValueT& GetValue(KeyT key);

      struct Pair {
        KeyT key;
        ValueT value;
      };
    private:
      int   _count; // number of used entries
      int   _size;  // number of entries in the hash table.
      struct IPair : Pair {
        IPair* _next;
      }* _data;  // pointer to an array of entries
    };


    template<typename KeyT, typename ValueT>
    class MutableDictionary : Dictionary<KeyT, ValueT>{
    public:
      void AddValue(KeyT key, ValueT value);
      void RemoveAllValues();
      void RemoveValue(KeyT key);
      void ReplaceValue(KeyT key, ValueT value);
      void SetValue(KeyT key, ValueT value);

    };

    // inline implementations
    template<typename KeyT, typename ValueT>
    Dictionary<KeyT,ValueT>::Dictionary():_count(0),_size(0),_data(0){
    }

    template<typename KeyT,typename ValueT>
    Dictionary<KeyT,ValueT>::~Dictionary(){
      free(_data);
    }

    template<typename KeyT, typename ValueT>
    inline ValueT& Dictionary<KeyT,ValueT>::operator[](KeyT key){
      return GetValue(key);
    }

    template<typename KeyT, typename ValueT>
    inline ValueT& Dictionary<KeyT,ValueT>::GetValue(KeyT key){
      for(int i=0; i<_count; i++);
    }


  }
}
